#include<bits/stdc++.h>
using namespace std;
int n, m;
vector<int> x1, x2, yy, y2;
#define VNAME(name) (#name)
#define F_(n) cout << fixed << setprecision(n)
#define gc() (ibo_ == ied_ ? (ied_ = buf + fread(ibo_ = buf, 1, 1 << 20, stdin), ibo_ == ied_ ? EOF : *ibo_++) : *ibo_++)
#define read() ({ int x = 0, f = 1; char c = gc(); while(c < '0' || c > '9') { if (c == '-') f = -1; c = gc();} while(c >= '0' && c <= '9') x = x * 10 + (c & 15), c = gc(); f * x; })
char buf[1 << 20], puf[1 << 20], *_p_ = puf, *ibo_, *ied_;
#define pr(x) (_p_ - puf == 1 << 20 ? (fwrite(puf, 1, 1 << 20, stdout), _p_ = puf) : 0, *_p_++ = x)
int print(long long x) { return x <= 9 ? pr(x + '0') : (print(x / 10), pr(x % 10 + '0')); }
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 255;
const int MOD = 1e9 + 7;
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
bool _OJ_Flag = true;
int arr[N];
bool gimp(LL x1, LL y1, LL x2, LL y2, LL x3, LL y3, LL x4, LL y4)
{
	LL z1, z2, z3, z4;
    //printf("%d %d %d %d %d %d %d %d\n", x1, y1, x2, y2, x3, y3, x4, y4);
	z1 = ((x2 - x1) * (y4 - y1) - (x4 - x1) * (y2 - y1)); if (z1 > 0) z1 = 1; else z1 = -1;
	z2 = ((x4 - x1) * (y3 - y1) - (x3 - x1) * (y4 - y1)); if (z2 > 0) z2 = 1; else z2 = -1;
	z3 = ((x4 - x2) * (y3 - y2) - (x3 - x2) * (y4 - y2)); if (z3 > 0) z3 = 1; else z3 = -1;
	z4 = ((x3 - x2) * (y1 - y2) - (x1 - x2) * (y3 - y2)); if (z4 > 0) z4 = 1; else z4 = -1;

	return z1 * z2 * z3 * z4 > 0; 
} 
int main(){
  cin >> n >> m;
  int rx[N], ry[N], hx[N], hy[N]; 
  for(int i = 1; i <= n; i++){
  	cin >> rx[i] >> ry[i];
  	x1.push_back(rx[i]);
  	yy.push_back(ry[i]);
  }
  for(int i = 1; i <= m; i++){
  	hx[i] = read(), hy[i] = read();
  	x2.push_back(hx[i]);
	y2.push_back(hy[i]);
  }
  sort(x1.begin(), x1.end());
  sort(yy.begin(), yy.end());
  sort(x2.begin(), x2.end());
  sort(y2.begin(), y2.end());
  if(x1[x1.size() - 1] < x2[0] || x1[0] > x2[x2.size() - 1]){
  	puts("NO");
  }else if(yy[yy.size() - 1] < y2[0] || yy[0] > y2[y2.size() - 1]){
  	puts("NO");
  }else{
  	if(n < 10 || m < 10){
	  	for (int i = 1; i <= n; ++ i) {
	        for (int j = i + 1; j <= n; ++ j) {
	            vector<PII> l, r;
	            for (int k = 1; k <= m; ++ k) {
	                if ((rx[i] - rx[j]) * (hy[k] - ry[i]) - (ry[i] - ry[j]) * (hx[k] - rx[i]) > 0) l.push_back({hx[k], hy[k]});
	                else r.push_back({hx[k], hy[k]});
	            }
	            for (auto a : l) {
	                for (auto b : r) {
	                    if (gimp(rx[i], ry[i], rx[j], ry[j], a.first, a.second, b.first, b.second)) {
	                        puts("YES");
	                        return 0;
	                    }
	                }
	            }
	        }
	    }
	    puts("NO");	
	}else{
		puts("YES");
	}
  	
  }
  return 0;
}